Class WordCount
java.lang.Object
WordCount
public class WordCount
- extends java.lang.Object
Count the number of words in an entire folder.
- Author:
- Marco Schmidt / Steven de Jong
|
Method Summary |
static void |
count(java.io.File file)
Open file, count its words, lines and characters
and print them to standard output. |
static void |
count(java.lang.String name,
java.io.BufferedReader in)
Count lines, words and characters in given input stream
and print stream name and those numbers to standard output. |
static long |
countWords(java.lang.String line)
Determine the number of words in the argument line. |
static void |
doCount(java.io.File file,
int level)
|
static void |
main(java.lang.String[] args)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
numLinesTotal
public static long numLinesTotal
numWordsTotal
public static long numWordsTotal
numCharsTotal
public static long numCharsTotal
WordCount
public WordCount()
count
public static void count(java.lang.String name,
java.io.BufferedReader in)
throws java.io.IOException
- Count lines, words and characters in given input stream
and print stream name and those numbers to standard output.
- Parameters:
name - name of input sourceinput - stream to be processed
- Throws:
java.io.IOException - if there were I/O errors
count
public static void count(java.io.File file)
- Open file, count its words, lines and characters
and print them to standard output.
- Parameters:
file - file to be processed
countWords
public static long countWords(java.lang.String line)
- Determine the number of words in the argument line.
- Parameters:
line - String to be examined, must be non-null
- Returns:
- number of words, 0 or higher
main
public static void main(java.lang.String[] args)
throws java.lang.Exception
- Throws:
java.lang.Exception
doCount
public static void doCount(java.io.File file,
int level)